#pragma once
#include"HashTable.h"
namespace xu
{
	template<class K>
	class unorderedset
	{
	public:

		struct SetOfK
		{
			const K& operator ()(const K& key)
			{
				return key;
			}
		};

		typedef typename xu1::HashTable<K, K, SetOfK>::const_iterator iterator;
		typedef typename xu1::HashTable<K, K, SetOfK>::const_iterator const_iterator;

		const_iterator begin()const
		{
			return _ha.begin();
		}

		const_iterator end()const
		{
			return _ha.end();
		}

		pair<iterator, bool> insert(const K& kv)
		{
			return _ha.Insert(kv);
		}

		bool erase(const K& key)
		{
			return _ha.Erase(key);
		}

		void printf()
		{
			_ha.Printf();
		}

		iterator Find(const K& key)
		{
			return _ha.Find(key);
		}
		
	private:
		xu1::HashTable<K, K, SetOfK> _ha;
	};
}
